<%@page import="java.sql.DriverManager"%>
<%@page import="java.sql.PreparedStatement"%>
<%@page import="java.sql.Connection"%>
<%@ page language="java" %>
<%
	String DRV = "org.mariadb.jdbc.Driver";
	String URL = "jdbc:mariadb://localhost:3306/siestageek?user=siestageek&password=987654";
	String SQL = "update boardv4 set title=?, uid=?, contents=? where bdno = ?";
	Connection conn = null;
	PreparedStatement pstmt = null;
%>
<%
	String bdno = request.getParameter("bdno");
	String title = request.getParameter("title");
	String uid = request.getParameter("uid");
	String contents = request.getParameter("contents");
	// 다시 한번 "\r\n" 를 "<br />" 로 변경
	contents = contents.replace("\r\n", "<br />");
%>
<%
	try {
		Class.forName(DRV);
		conn = DriverManager.getConnection(URL);
		pstmt = conn.prepareStatement(SQL);
			pstmt.setString(1, title);
			pstmt.setString(2, uid);
			pstmt.setString(3, contents);
			pstmt.setString(4, bdno);
		pstmt.executeUpdate();
	} catch (Exception ex) {
		ex.printStackTrace();
	} finally {
		if (pstmt != null) try { pstmt.close(); } catch (Exception e) {}
		if (conn != null) try { conn.close(); } catch (Exception e) {}
	}
%>
<%
	try { response.sendRedirect("list.jsp"); } 
		catch (Exception e) { }
%>













